#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    // 点击 "确认" 按钮，将所选的安排显示到上面
    QString result = "今天你的安排是：";
    // 如果选择了，就加到 result 里面去
    if(ui->checkBox_study->isChecked()) result += ui->checkBox_study->text() + " ";
    if(ui->checkBox_game->isChecked()) result += ui->checkBox_game->text() + " ";
    if(ui->checkBox_sleep->isChecked()) result += ui->checkBox_sleep->text();
    // 显示到上面的 label 去
    ui->label->setText(result);
}
